package com.microservices.cloud.service.impl;

import com.microservices.cloud.dao.AccountDao;
import com.microservices.cloud.service.AccountService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
@Slf4j
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountDao accountDao;

    @Override
    public Integer updateAccount(Long userId, BigDecimal money) {
        log.info("------------>account-service中扣减账户开始");
        Integer result = accountDao.updateAccount(userId, money);
        log.info("------------>account-service中扣减账户结束");
        return result;
    }
}
